package com.zhiyou100.test.test04.demo;

/**
 * @author yang
 * @className SimpleProxyDemo
 * @packageName com.zhiyou100.test.test04.demo
 * @Description TODO 简单代理 demo
 * @date 2020-08-11 11:47
 */
public class SimpleProxyDemo {
    public static void consumer(Interface iface) {
        iface.doSomething();
        iface.somethingsElse("bonobo");
    }

    public static void main(String[] args) {
        consumer(new RealObject());
        consumer(new SimpleProxy(new RealObject()));
        //     doSomething
        //somethingElse  bonobo
        //simpleProxy doSomething
        //doSomething
        //simpleProxy somethingElsebonobo
        //somethingElse  bonobo
    }
}
